using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Local
{
    /// <summary>
    /// <para>Rank</para>
    /// <para>Ranks on a cell-by-cell basis the values from a set of input rasters and determines which values are returned based on the value of the rank input raster.</para>
    /// <para>对一组输入栅格中的值进行逐个单元格排序，并根据排名输入栅格的值确定返回哪些值。</para>
    /// </summary>    
    [DisplayName("Rank")]
    public class Rank : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Rank()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_rank_raster_or_constant">
        /// <para>Input rank raster or constant value</para>
        /// <para><xdoc>
        ///   <para>The input raster that defines the rank position to be returned.</para>
        ///   <para>A number can be used as an input; however, the cell size and extent must first be set in the environment.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于定义要返回的排名位置的输入栅格。</para>
        ///   <para>数字可以用作输入;但是，必须首先在环境中设置像元大小和范围。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_rasters">
        /// <para>Input rasters</para>
        /// <para><xdoc>
        ///   <para>The list of input rasters from which the cell value of the raster at the specified rank position will be obtained.</para>
        ///   <para>For example, consider a particular location where the cell values in the three input rasters are 17, 8 and 11. The rank value for that location is defined as 3. The tool will first sort the input values. Since the rank value being requested is 3, the output value will be 17.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格列表，从中获取指定排名位置的栅格的像元值。</para>
        ///   <para>例如，假设三个输入栅格中的像元值为 17、8 和 11 的特定位置。该位置的排名值定义为 3。该工具将首先对输入值进行排序。由于请求的排名值为 3，因此输出值将为 17。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>For each cell on the output raster, the values on the input rasters are sorted from lowest to highest, and the input rank raster's value is used to select which will be the output value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>对于输出栅格上的每个像元，输入栅格上的值将按从低到高的顺序排序，并使用输入等级栅格的值来选择输出值。</para>
        /// </xdoc></para>
        /// </param>
        public Rank(object _in_rank_raster_or_constant, List<object> _in_rasters, object _out_raster)
        {
            this._in_rank_raster_or_constant = _in_rank_raster_or_constant;
            this._in_rasters = _in_rasters;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Rank";

        public override string CallName => "sa.Rank";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_rank_raster_or_constant, _in_rasters, _out_raster, _process_as_multiband.GetGPValue()];

        /// <summary>
        /// <para>Input rank raster or constant value</para>
        /// <para><xdoc>
        ///   <para>The input raster that defines the rank position to be returned.</para>
        ///   <para>A number can be used as an input; however, the cell size and extent must first be set in the environment.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于定义要返回的排名位置的输入栅格。</para>
        ///   <para>数字可以用作输入;但是，必须首先在环境中设置像元大小和范围。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input rank raster or constant value")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_rank_raster_or_constant { get; set; }


        /// <summary>
        /// <para>Input rasters</para>
        /// <para><xdoc>
        ///   <para>The list of input rasters from which the cell value of the raster at the specified rank position will be obtained.</para>
        ///   <para>For example, consider a particular location where the cell values in the three input rasters are 17, 8 and 11. The rank value for that location is defined as 3. The tool will first sort the input values. Since the rank value being requested is 3, the output value will be 17.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格列表，从中获取指定排名位置的栅格的像元值。</para>
        ///   <para>例如，假设三个输入栅格中的像元值为 17、8 和 11 的特定位置。该位置的排名值定义为 3。该工具将首先对输入值进行排序。由于请求的排名值为 3，因此输出值将为 17。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input rasters")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_rasters { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output raster.</para>
        ///   <para>For each cell on the output raster, the values on the input rasters are sorted from lowest to highest, and the input rank raster's value is used to select which will be the output value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出栅格。</para>
        ///   <para>对于输出栅格上的每个像元，输入栅格上的值将按从低到高的顺序排序，并使用输入等级栅格的值来选择输出值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Process as multiband</para>
        /// <para><xdoc>
        ///   <para>Specifies how the input multiband raster bands will be processed.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Each band from a multiband raster input will be processed separately as a single band raster. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Each multiband raster input will be processed as a multiband raster. The operation will be performed for each band from one input using the corresponding band number from the other inputs.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何处理输入多波段栅格波段。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中—多波段栅格输入中的每个波段将作为单波段栅格单独处理。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中—每个多波段栅格输入将作为多波段栅格进行处理。将使用来自其他输入的相应频段编号对一个输入的每个频段执行该操作。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Process as multiband")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _process_as_multiband_value _process_as_multiband { get; set; } = _process_as_multiband_value._false;

        public enum _process_as_multiband_value
        {
            /// <summary>
            /// <para>SINGLE_BAND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SINGLE_BAND")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>MULTI_BAND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MULTI_BAND")]
            [GPEnumValue("true")]
            _true,

        }

        public Rank SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}